<template>
    <div>
        <el-button @click="prints" type="primary">
            print
        </el-button>
    </div>
</template>

<script setup>
    import { onMounted, computed, ref } from 'vue';
    import jsPDF from 'jspdf'
    import html2canvas from 'html2canvas'
    // import { usePDFGenerator, convertDocxToPdf } from './index.js'
    import { usePDFGenerator } from './print.js'
    const { generatePDF } = usePDFGenerator()
    const urls = ref([
        {
            "id": "1907364476340899840",
            "originalName": "bo.pdf",
            "fileName": "e8286bf022e23cb5e3e8c99a49cf4695.pdf",
            "fileExtension": "pdf",
            "ossPath": "2025/04/02/e8286bf022e23cb5e3e8c99a49cf4695.pdf",
            "fileUrl": "http://122.112.180.184:9000/hzbim/2025/04/02/e8286bf022e23cb5e3e8c99a49cf4695.pdf"
        },
        {
            "id": "1907364520502726656",
            "originalName": "微信图片_20220413114245.jpg",
            "fileName": "026eacf4843bb099b7440f0a0a4b1000.jpg",
            "fileExtension": "jpg",
            "ossPath": "2025/04/02/026eacf4843bb099b7440f0a0a4b1000.jpg",
            "fileUrl": "http://122.112.180.184:9000/hzbim/2025/04/02/026eacf4843bb099b7440f0a0a4b1000.jpg"
        },
        {
            "id": "1907364541012873216",
            "originalName": "状态类型.docx",
            "fileName": "3bd6e33eb3acd58685a48afe01be39ab.docx",
            "fileExtension": "docx",
            "ossPath": "2025/04/02/3bd6e33eb3acd58685a48afe01be39ab.docx",
            "fileUrl": "http://122.112.180.184:9000/hzbim/2025/04/02/3bd6e33eb3acd58685a48afe01be39ab.docx"
        }
    ])
    const changeForm = () => {
        forms.value.name = '111'
    }
    const prints = () => {
        generatePDF(urls.value.map(i => i.fileUrl))
    }
    onMounted(() => {
        //
    });
</script>

<style lang="scss" scoped>

</style>